<html>
<head>
        <meta charset="UTF-8">
        <title></title>
        <script type="text/javascript">
            function elegir(clave,valor) {
                if (window.opener){
                    //alert('elegido ' + clave + ' con id ' + valor);
                    //alert(window.opener.document.getElementById('addresultadoForm'));
                    window.opener.document.getElementById('addjornadaForm').idorganizador.value=valor;
                    window.close();
                }
            }
        </script>
    </head>
    <body>       
        
        <?php
        include_once('../includes/utilidades.php');
        session_start();
        $filtro = '';

        if (!isset($_REQUEST['filtro'])) {
            $filtro = '';
        } else {
            $filtro = $_REQUEST['filtro'];
        }
          
        if (isset($_SESSION['estado']['temporada'][0]['id']))
            $idtemporada = $_SESSION['estado']['temporada'][0]['id'];
        
        if (isset($_SESSION['estado']['rpruebajornada'][0]['idcategoria']))
            $idcategoria = $_SESSION['estado']['rpruebajornada'][0]['idcategoria'];
//print_r($tablas);
        /*
         * To change this license header, choose License Headers in Project Properties.
         * To change this template file, choose Tools | Templates
         * and open the template in the editor.

          CREATE OR REPLACE VIEW vatletatemporadaclub AS
          SELECT at.nombre AS Nombre, at.apellido1 AS Apellido1, at.Apellido2 AS Apellido2, at.fechanacimiento AS FechaNacimiento, gen.nombre AS Genero, cl.id AS idclub, cl.nombre AS Club, te.id AS idtemporada, te.nombre AS Temporada, cat.id as idcategoria, cat.nombre as Categoria
          FROM atleta at, temporada te, club cl, ratletatemporadaclub rel, genero gen, categoria cat
          WHERE rel.idatleta = at.id
          AND rel.idclub = cl.id
          AND at.idgenero = gen.id
          and rel.idcategoria = cat.id
          AND rel.idtemporada =1


         */

        //conectaDb();
        print "<form name='f' action='searchclub.php'>";
        print "<input type='text' name='filtro'>";
        print "<input type='submit' value='Aplicar'>";
        print "</form>";

        $sql = "select id,nombre,zona,localidad"
                . " from club where 1=1"                
                . " and (nombre like '%" . $filtro . "%' or zona like '%" . $filtro . "%')";
          
        //print $sql;
        $club = select2($sql);
        toHTMLSearch('club', $club, 'id');
        
        //
        //
        //
        //print_r($registros);
        //print "<hr>";
        //print $actual;
        //print "<br>";
// print $_SERVER['PHP_SELF'];
        //print_r($_ENV);
        //print_r($_SERVER);
        ?>

    </body>
</html>

